{% extends '::base.html.twig' %}

{% block title %}Funding Agencies{% endblock %}

{% block topbar %}
<div id="topbar" style="background: url('/images/green.png') repeat-x scroll 0 0 #B0B0B0">
    <strong class="wrapper">
        Funding Agencies
    </strong>
</div>
{% endblock %}

{% block bodyclass %} class="fullwidth"{% endblock %}

{% block body %}
<div class="wrapper">
    <div id="content">
        <div class="entry">
            <h2>Funding agencies</h2>
            <div class="spacer"></div>

            {% for entity in entities %}
            <div class="one-third portfolio-item{% if ((loop.index-1) % 3) == 2 %} last{% endif %}">
                {% if entity.getWebPath() %}
                    <img class="rounded" src="{{ entity.getWebPath() }}" alt='{{ entity.name }}' width='280' height='125' />
                {% endif %}
                <h3><a href="{{ url('fundingagency_show', { 'id': entity.id }) }}">{{ entity.name | capitalize  }}</a></h3>
                <p>
                    {{ entity.description | raw }}
                    <span class="read-more">
                        {% if entity.website %}
                        <a href="{{ entity.website }}" title="{{ entity.name }}" target="_blank" rel="nofollow">Visit Site</a>
                        {% endif %}
                        <a href="{{ url('fundingagency_show', { 'id': entity.id }) }}">Read more »</a>
                    </span>
                </p>
            </div>
            {% if ((loop.index-1) % 3) == 2 %}<div class="big-spacer"></div>{% endif %}
            {% endfor %}

            <div class="divider"></div>
        </div>
        <!-- END .entry -->

        {% if lastPageNumber > 1 %}
        <div class="paginator">
            <div class="pagingContainer">
                {% if page > 1 %}
                    <a href="{{ url('fundingagency') }}" class="first">First</a>
                    <a href="{{ url('fundingagency', {'page' : page - 1}) }}">« Prev</a>
                {% endif %}
                <div>
                    {% for numberOfPage in 1..lastPageNumber %}
                        <a href="{{ url('fundingagency', {'page' : numberOfPage}) }}" class="
                        {% if (numberOfPage == lastPageNumber) and (numberOfPage == page) %}
                        last
                        {% elseif (numberOfPage == 1) and (numberOfPage == page) %}first{% endif %}
                        {% if numberOfPage == page %}
                         active{% endif%}">{{ numberOfPage }}</a>
                        
                    {% endfor %}
                </div>
                {% if page < lastPageNumber %}
                    <a href="{{ url('fundingagency', {'page' : page + 1}) }}">Next »</a>
                    <a href="{{ url('fundingagency', {'page' : lastPageNumber}) }}" class="last">Last</a>
                {% endif %}
            </div>
        </div>
        {% endif %}
        <!-- END .paginator -->
    </div>
    <!-- END #content -->      
</div>
<!-- END .wrapper -->
{% endblock %}

{#% block bottombar %}
<span class="info"></span>
<a href="{{ path('home_page') }}">Home</a>
<span> » </span>
<a href="{{ path('goo_show') }}">GOO</a>
<span> » </span>
<a href="{{ path('fundingagency') }}" class="active">Funding Agencies</a>
{% endblock %#}

